package com.wry.wry_test.demo;

/**
 * @Author: wangrongyi
 * @Date: 2025/2/13 17:07
 * @Description:
 */
public class NioDemo {


    public static void main(String[] args) {


    }

    public int maxArea(int[] height) {
        int max = 0;
        for (int i = 0, j = height.length - 1; i != j; ) {

            int capacity = (j - i) * Math.min(height[i], height[j]);
            max = Math.max(max, capacity);
            if (height[i] < height[j]) {
                i++;
            } else {
                j--;
            }
        }
        return max;
    }
}
